<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./node_modules/vue/dist/vue.min.js"></script>
</head>
<body>
    <div id="app">
        <h1 id="hh">{{msg}}</h1>
    </div>
</body>
</html>
<script>
    const vm = new Vue({
        el:"#app",
        data:{
            msg:"钩子函数"
        },
        beforeCreate () {
            console.group('beforeCreat')
            console.log("虚拟dom===",this.$el);
            console.log("数据===",this.$data);
            console.log('h1===',document.getElementById("hh").innerText);
            console.groupEnd()
        },
        created () {
            console.group('created')
            console.log("虚拟dom===",this.$el);
            console.log("数据===",this.$data);
            console.log('h1===',document.getElementById("hh").innerText);
            console.groupEnd()
        },
        beforeMount () {
            console.group('beforeMount')
            console.log("虚拟dom===",this.$el);
            console.log("数据===",this.$data);
            console.log('h1===',document.getElementById("hh").innerText);
            console.groupEnd()
        },
        mounted () {
            console.group('mounted')
            console.log("虚拟dom===",this.$el);
            console.log("数据===",this.$data);
            console.log('h1===',document.getElementById("hh").innerText);
            console.groupEnd()
        },
        beforeUpdate () {
            
        },
        updated () {
            
        },
        beforeDestroy () {
            
        },
        destroyed () {
             
        }

    })
</script>